<template>
  <div>
     <img :src="imgUrl" alt="" width="200" /> 
    <input type="file" @change="fn1" /> 
  </div>
</template>

<script>
export default {
  data() {
    return {
      showMsg: '',
      imgUrl: '',
    }
  },
  methods: {
    fn(e) {
      this.showMsg = e.target.value
      e.target.value = ''
    },
    fn1(e) {
      const imgFile = e.target.files[0]
      this.imgUrl = URL.createObjectURL(imgFile)
    },
  },
}
</script>

<style></style>
